updating oE mem_set

mem_set

<built-in> procedure mem_set(atom destination, integer byte_value, integer how_many)) 

sets a contiguous range of memory locations to a single value.

Parameters:
  1. destination : an atom, the address starting the range to set.
  2. byte_value : an integer, the value to copy at all addresses in the range.
  3. how_many : an integer, how many bytes are to be set.
Comments:

The low order 8 bits of byte_value are actually stored in each byte. mem_set(destination, byte_value, how_many) is equivalent to: poke(destination, repeat(byte_value, how_many)) but is much faster.

Example 1:
destination = allocate(1000) 
mem_set(destination, ' ', 1000) 
-- 1000 consecutive bytes in memory will be set to 32 
-- (the ASCII code for ' ') 
See Also:

Using Data Bytes, peek, poke, allocate, free, mem_copy

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu